package xcmg.device.infra.enums;

import org.apache.commons.lang.StringUtils;

/**
 * @author wangyong
 */

public enum DeliveryNoteOutStatusEnum {

  NO_OUT("0", "未出库"),
  PART_OUT("1", "部分出库"),
  ALREADY_OUT("2", "已出库"),
  FINISH("3", "强制完成");

  private String status;

  private String desc;

  /**
   * 根据状态获取描述
   */
  public static String getDescByStatus(String status) {
    if (StringUtils.isBlank(status)) {
      return NO_OUT.getDesc();
    }
    for (DeliveryNoteOutStatusEnum statusEnum : DeliveryNoteOutStatusEnum.values()) {

      if (statusEnum.getStatus().equals(status)) {
        return statusEnum.getDesc();
      }
    }
    return NO_OUT.getDesc();
  }

  DeliveryNoteOutStatusEnum(String status, String desc) {
    this.status = status;
    this.desc = desc;
  }

  public String getStatus() {
    return status;
  }

  public void setStatus(String status) {
    this.status = status;
  }

  public String getDesc() {
    return desc;
  }

  public void setDesc(String desc) {
    this.desc = desc;
  }
}
